import request from '@/utils/request'
import defaultSettings from '@/settings'

export const apiUrlConfig = {
  queryUrl: `${defaultSettings.ctx.authorityApp}/s/superExportDownload/search`,
  exportUrl: `${defaultSettings.ctx.authorityApp}/s/superExportDownload/search`,
  delUrl: `${defaultSettings.ctx.authorityApp}/s/superExportDownload/remove`,
}

// 查询列表
export function listExportManagement(query) {
  return request({
    url: `${defaultSettings.ctx.authorityApp}/s/superExportDownload/search`,
    method: 'get',
    params: query
  })
}
// 下载文件
export function download(fileId,serviceName) {
  let url = `${(defaultSettings.ctx.authorityApp == '' ? 'authority-app' : defaultSettings.ctx.authorityApp)}/s/superExportDownload/download?serviceName=${serviceName}&fileId=${fileId}`;
  window.location.href = url;
}
// 删除
export function delExportManagement(id) {
  return request({
    url: `${defaultSettings.ctx.authorityApp}/s/superExportDownload/remove?ids=${id}`,
    method: 'get'
  })
}
